{% extends "index.html" %} {% block main %}
<style>
    .editormd-html-preview {
        width: 60%;
        margin: 0 auto;
    }
</style>
<div id="test-editormd-view">
    <textarea style="display:none;">###Hello world!</textarea>
</div>
<script src="/static/lib/editor.md/lib/marked.min.js"></script>
<script src="/static/lib/editor.md/lib/prettify.min.js"></script>

<script src="/static/lib/editor.md/lib/raphael.min.js"></script>
<script src="/static/lib/editor.md/lib/underscore.min.js"></script>
<script src="/static/lib/editor.md/lib/sequence-diagram.min.js"></script>
<script src="/static/lib/editor.md/lib/flowchart.min.js"></script>
<script src="/static/lib/editor.md/lib/jquery.flowchart.min.js"></script>

<script src="/static/lib/editor.md/editormd.js"></script>
<script>
    console.log()
    $.get('/api/information/'+location.pathname.split('/')[location.pathname.split('/').length-1],function (data,status) {
        var testEditormdView = editormd.markdownToHTML("test-editormd-view", {
            markdown        : data[0].content ,//+ "\r\n" + $("#append-test").text(),
            //htmlDecode      : true,       // 开启 HTML 标签解析，为了安全性，默认不开启
            htmlDecode      : "style,script,iframe",  // you can filter tags decode
            //toc             : false,
            tocm            : true,    // Using [TOCM]
            //tocContainer    : "#custom-toc-container", // 自定义 ToC 容器层
            //gfm             : false,
            //tocDropdown     : true,
            // markdownSourceCode : true, // 是否保留 Markdown 源码，即是否删除保存源码的 Textarea 标签
            emoji           : true,
            taskList        : true,
            tex             : true,  // 默认不解析
            flowChart       : true,  // 默认不解析
            sequenceDiagram : true,  // 默认不解析
        });
    })

</script>
{% endblock %}